<?php
include_once "xAP-functions/webincludes.php";

$type[0]="Image Store";
$type[1]="CCTV Camera";

$id=intval($_GET["id"]);
$url="http://www.bbc.co.uk/cgi-perl/weather/search/new_search.pl";
echo webpageheader();

$sql="select * from xAP_Pictures_Source where SourceID=".$id;
$results=dbquery($sql);
$row=$results[0];

$row["SourceType"]=intval($row["SourceType"]);

//display
?>

<form name='settings' method='POST' action='config_setup_update.php'>
<input type='hidden' name='id' value='<?=$id?>'>
<table >
<TR><TD class='boldtext'>Alias</td><TD class='boldtext' colspan=3><input name='Alias' size=40 value="<?=$row["Alias"]?>"></td></tr>
<TR><TD class='boldtext'>Location</td><TD class='boldtext' colspan=3><input name='Location' size=60 value="<?=$row["Location"]?>"></td></tr>
<TR><TD class='boldtext'>Monitor</td><TD class='normaltext' colspan=3><input name='MonitorLocation' size=60 value="<?=$row["MonitorLocation"]?>"><i>Watched folder for CCTV sources</i></td></tr>
<TR><TD class='boldtext'>Type</td><TD class='boldtext' colspan=3><select name='SourceType'>
<Option value=<?=$row["SourceType"]?>><?=$type[$row["SourceType"]]?>
<?foreach($type as $key=>$value):?>
<?php if($key!=$row["SourceType"]): ?>
<option value=<?=$key?>><?=$value?>
<?php endif;?>
<?endforeach;?>
</select></td></tr>
<?php if($id!=0): ?>
<TR><TD class='boldtext'>Delete</td><TD class='boldtext' colspan=3><input type='checkbox' name='delete' value='1'></td></tr>
<?php endif;?>
<TR><TD class='boldtext'></td><TD class='boldtext' colspan=3><input type='submit' value='Update'></td></tr>
</table>

</form>

<?php
echo webpagefooter();
?>